/* 组件通用样式 */
.walletConnect,
.transaction,
.contractInteraction,
.tokenBalance {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.walletConnect:hover,
.transaction:hover,
.contractInteraction:hover,
.tokenBalance:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 标题样式 */
h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: #555;
  font-size: 14px;
  font-weight: 500;
}

/* 输入框组样式 */
.inputGroup {
  margin-bottom: 15px;
}

.inputGroup label {
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* 带按钮的输入框容器 */
.inputWithButton {
  position: relative;
  display: flex;
  align-items: center;
}

.textareaWithButton {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 复制按钮样式 */
.copyButton {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
  z-index: 10;
}

.textareaWithButton .copyButton {
  right: 8px;
  top: 28px;
  transform: none;
}

.copyButton:hover {
  opacity: 1;
  background: rgba(0, 112, 243, 0.1);
}

/* 错误状态样式 */
.inputError {
  border-color: #f44336 !important;
}

.errorMessage {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 0;
  line-height: 1.4;
}

/* 加载状态按钮 */
.buttonWithLoader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inputGroup input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.inputGroup input:focus {
  outline: none;
  border-color: #0070f3;
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.1);
}

.inputGroup textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
  resize: vertical;
  min-height: 80px;
}

.inputGroup textarea:focus {
  outline: none;
  border-color: #0070f3;
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.1);
}

/* 按钮样式 */
.actionButton {
  background: #0070f3;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 10px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  box-shadow: 0 2px 4px rgba(0, 112, 243, 0.2);
}

.actionButton:hover:not(:disabled) {
  background: #0051c5;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 112, 243, 0.3);
}

.actionButton:hover:not(:disabled) {
  background: #0051c5;
}

.actionButton:active:not(:disabled) {
  transform: translateY(1px);
}

.actionButton:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* 连接状态样式 */
.connectionStatus {
  margin-top: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 14px;
}

.connectionStatus.connected {
  background: #e8f5e9;
  color: #2e7d32;
}

.connectionStatus.disconnected {
  background: #ffebee;
  color: #c62828;
}

/* 信息展示区域样式 */
.infoDisplay {
  margin-top: 15px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 14px;
}

.infoDisplay p {
  margin: 5px 0;
  color: #333;
}

.infoDisplay strong {
  color: #0070f3;
}

/* 合约结果展示 */
.contractResult {
  margin-top: 15px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 函数调用区域样式 */
.contractFunctionSection {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 8px;
}

.contractAddressDisplay {
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
  max-width: 60%;
}

/* 代币信息样式 */
.tokenInfo {
  margin-top: 15px;
  padding: 15px;
  background: #e3f2fd;
  border-radius: 4px;
  border-left: 4px solid #1976d2;
}

.tokenInfo p {
  margin: 8px 0;
  color: #333;
}

.tokenInfo strong {
  color: #1565c0;
}

/* 代币列表样式 */
.tokenLists {
  margin-top: 20px;
}

.tokenList {
  margin-bottom: 15px;
}

.tokenButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tokenButton {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.tokenButton:hover {
  background: #0070f3;
  color: white;
  border-color: #0070f3;
}

/* 提示文本样式 */
.note {
  color: #666;
  font-size: 12px;
  margin-top: 8px;
  font-style: italic;
}

/* 警告信息样式 */
.warning {
  color: #ff9800;
  font-size: 14px;
  margin-top: 15px;
  padding: 12px 16px;
  background: #fff3e0;
  border-radius: 6px;
  border-left: 4px solid #ff9800;
  transition: all 0.3s ease;
}

.warning:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(255, 152, 0, 0.1);
}

/* 错误信息样式 */
.error {
  color: #f44336;
  font-size: 14px;
  margin-top: 10px;
  padding: 10px;
  background: #ffebee;
  border-radius: 4px;
  border-left: 4px solid #f44336;
}

/* 卡片切换样式 */
.cardTabs {
  display: flex;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
}

.cardTab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.cardTab.active {
  color: #0070f3;
  border-bottom: 2px solid #0070f3;
}

.cardTab:hover:not(.active) {
  color: #333;
  background: #f5f5f5;
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0070f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .walletConnect,
  .transaction,
  .contractInteraction,
  .tokenBalance {
    padding: 15px;
  }
  
  .actionButton {
    width: 100%;
    margin-right: 0;
  }
  
  .cardTabs {
    flex-wrap: wrap;
  }
  
  .cardTab {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .tokenButtons {
    gap: 8px;
  }
  
  .tokenButton {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .sectionHeader {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .contractAddressDisplay {
    max-width: 100%;
  }
}